var elixir = require('laravel-elixir');
var webpickCfg = require('./webpack.config.js');
require('laravel-elixir-vueify');
require('laravel-elixir-webpack');
require('./elixir-langjs');
/*
 |--------------------------------------------------------------------------
 | Elixir Asset Management
 |--------------------------------------------------------------------------
 |
 | Elixir provides a clean, fluent API for defining some basic Gulp tasks
 | for your Laravel application. By default, we are compiling the Sass
 | file for our application, as well as publishing vendor resources.
 |
 */


elixir.config.sourcemaps = true;



elixir(function (mix) {
    mix.langjs();
    // 复制Chosen的图片资源
    // mix.copy('public/vendors/bower_components/chosen/chosen-sprite@2x.png','public/css/chosen-sprite@2x.png');
    // mix.copy('public/vendors/bower_components/chosen/chosen-sprite.png','public/css/chosen-sprite.png');
    // mix.sass('app.scss');
    // 合并CSS
    mix.styles([
        'vendors/bower_components/bootstrap-select/dist/css/bootstrap-select.min.css',
        'vendors/bower_components/fullcalendar/dist/fullcalendar.min.css',
        'vendors/bower_components/animate.css/animate.min.css',
        'vendors/bower_components/chosen/chosen.min.css',
        'vendors/bower_components/bootstrap-sweetalert/lib/sweet-alert.css',
        'vendors/bower_components/material-design-iconic-font/dist/css/material-design-iconic-font.min.css',
        'vendors/bower_components/malihu-custom-scrollbar-plugin/jquery.mCustomScrollbar.min.css',
        'vendors/bootgrid/jquery.bootgrid.min.css',
        'vendors/css/app.min.1.css',
        'vendors/css/app.min.2.css'
    ],
      'public/css/platform.css',
      'public');


    // 合并JS
    mix.scripts([
        'vendors/bower_components/jquery/dist/jquery.min.js',
        'vendors/bower_components/lodash/dist/lodash.min.js',
        'vendors/bower_components/bootstrap/dist/js/bootstrap.min.js',
        'vendors/bower_components/flot/jquery.flot.js',
        'vendors/bower_components/flot/jquery.flot.resize.js',
        'vendors/bower_components/flot.curvedlines/curvedLines.js',
        'vendors/sparklines/jquery.sparkline.min.js',
        'vendors/bower_components/jquery.easy-pie-chart/dist/jquery.easypiechart.min.js',
        'vendors/bower_components/moment/min/moment.min.js',
        'vendors/bower_components/fullcalendar/dist/fullcalendar.min.js',
        'vendors/bower_components/simpleWeather/jquery.simpleWeather.min.js',
        'vendors/bower_components/Waves/dist/waves.min.js',
        'vendors/bootstrap-growl/bootstrap-growl.min.js',
        'vendors/bower_components/bootstrap-sweetalert/lib/sweet-alert.min.js',
        'vendors/bower_components/bootstrap-select/dist/js/bootstrap-select.min.js',
        'vendors/bower_components/malihu-custom-scrollbar-plugin/jquery.mCustomScrollbar.concat.min.js',
        'vendors/bower_components/chosen/chosen.jquery.min.js',
        'vendors/bower_components/flot-charts/curved-line-chart.js',
        'vendors/bower_components/flot-charts/line-chart.js',
        'vendors/bootgrid/jquery.bootgrid.updated.min.js',
        'vendors/js/charts.js',
        'vendors/js/functions.js'
    ],
      'public/js/platform.js',
      'public');

    // Dashboard entry js
    // mix.browserify('dashboard.js');
    // 输出文件名有问题
    mix.webpack(['*.js'], webpickCfg);

    // mix.version(['public/css/platform.css','public/js/platform.js','public/js/dashboard.js']);

    //mix.browserSync({ proxy: 'my.app:8080' });
    // For MacPro-15
    mix.browserSync({ proxy: 'janus.com' });
});
